Tutorial

Testing locally

Open a IPython Qt terminal:

  • For Windows using Anaconda: start-menu - Anaconda3 - IPython or Jupyter QtConsole.
  • In Linux open an IPython terminal. For example by opening a terminal and running ipython3

To see a test image, run (copy paste the whole code block into the IPython terminal):

>>> import fpd_live_imaging.testing_tools as tt
>>> import fpd_live_imaging.acquisition_control_class as acc
>>> from fpd_live_imaging.test_images.test_images import linux_penguin_64
>>> acquisition_control = acc.LiveImagingQt()
>>> test_detector = tt.TestDetectorInputImage(number_of_frames=64*64, input_image=linux_penguin_64)
>>> test_detector.sleep_time.value = 0.001
>>> test_detector.start_data_listening()
>>> acquisition_control._comm_medi.port = test_detector.port
>>> acquisition_control.start_bf_process()
>>> acquisition_control.resize_scan(64, 64)
>>> acquisition_control.start_medipix_receiver()

To shutdown the script after the image has finished:

>>> acquisition_control.cancel_all_processes()

Live system

Running on a system with a Medipix3 detector and Merlin readout system. This library interfaces with the Merlin readout system through the TCP/IP API.

First start the Merlin readout system, then open the Anaconda Jupyter QtConsole.

To start a simple live imaging (simply copy-paste into the QtConsole):

>>> import fpd_live_imaging.acquisition_control_class as acc
>>> acquisition_control = acc.LiveImagingQt()
>>> acquisition_control.start_bf_process()
>>> acquisition_control.start_full_diffraction_image_process()
>>> acquisition_control.resize_scan(64, 64)
>>> acquisition_control.start_medipix_receiver()

To stop the live imaging

>>> acquisition_control.cancel_all_processes()

Alternatively, to reset the live imaging, close the QtConsole.

Annular dark field:

>>> acquisition_control.start_adf_process()
>>> adf0 = acquisition_control.process_dict['ADF0']['proc']
>>> adf0.centreX = 100
>>> adf0.centreY = 90
>>> adf0.radius0 = 20
>>> adf0.radius1 = 40

Magnetic imaging:

>>> acquisition_control.start_com_x_threshold_process()
>>> acquisition_control.start_com_y_threshold_process()
>>> com_x = acquisition_control.process_dict['CoMxT']['comm']
>>> com_y = acquisition_control.process_dict['CoMyT']['comm']
>>> com_x.threshold_multiplier = 2.
>>> com_y.threshold_multiplier = 2.